<!doctype html>

<html>
<head>
    <meta charset=UTF-8>
    <meta name=Generator content=baidu.com>
    <meta name=Author content=作者>
    <meta name=Keywords content=关键词>
    <meta name=Description content=文档描述信息>
    <style type="text/css">
        *{margin:0;padding:0;}
        address, cite, dfn, em, var{font-style:normal;}
        li{font-style:normal;}
        a{text-decoration:none;color:#f40;}
        a:hover { text-decoration:underline;}
        table{border-collapse:collapse; border-spacing:0;}
        ul, ol { list-style:none; }
        h1, h2, h3, h4, h5, h6{ font-size:100%; }
        fieldset, img { border:0; }
        tr,td{border:1px solid #d219192b;text-align:center;}
    </style>
    <title>js生成10行10列</title>
</head>
<body>
<script>
    document.write('<table border=1 width="400px" height="400px">');
    var num=1;
    for (var a=1;a<=10;a++)
    {
        document.write('<tr>');
        for (var b=1;b<=10;b++)
        {
            document.write('<td>'+num+'</td>');
            num++;
        }
        document.write('</tr>');
    }
    document.write('</table>');
</script>
</body>
</html>